<?php
	class InteretsPro{
		private $id; // l'id de la question courante
		private $idRefEleve; // l'id de l'eleve	
		private $idRefReponse; // l'id de la réponse
		private $classement; //le classement de la réponse

	
		public function __construct(){
			if(func_num_args() == 1)
			$this->hydrate(func_get_arg(0));
		}
		
		public function hydrate(array $donnees){
			foreach ($donnees as $key => $value){
				$method = 'set'.ucfirst($key);
				if (method_exists($this, $method)){
					$this->$method($value);
				}
			}
		}
		
		// GETTERS
		public function id(){return $this->id;}
		public function idRefEleve(){return $this->idRefEleve;}
		public function idRefReponse(){return $this->idRefReponse;}
		public function classement(){return $this->classement;}
		
		// SETTERS
		public function setId($newId){$this->id = $newId;}
		public function setIdRefEleve($newIdRefEleve){$this->idRefEleve = $newIdRefEleve;}
		public function setIdRefReponse($newIdRefReponse){$this->idRefReponse = $newIdRefReponse;}
		public function setClassement($newClassement){$this->classement = $newClassement;}
	}
?>